[October 29,2024] [Tuesday] [sunny]
Yesterday, I studied Linux drivers. I used Linux drivers to obtain the information in the device tree, including strings, arrays,etc.
For stings, I used the of_find_property() function. There are two functions to obtain arrays.
The first one is of_property_read_u32_index(). This function is used to obtain the value of a specified element, and there is only one element.
However, I used a for loop to obtain multiple elements.
The second one is of_property_read_u32_array(). This function can automatically obtain all the elements in the array.
Today, I will continue to study Linux drivers. I will learn how to register drivers through device tree matching.
Because the previous drivers were all registered through the entry and exit functions.